Gaussian lowpass filter, page 276.

$ H(u,v) = e^{\frac{-D^2(u,v)}{2D_0}} $


In [1]:
%run ../common.ipynb
from __future__ import division
image = imread('../MP.tiff')
F = fft2(image)


Populating the interactive namespace from numpy and matplotlib

In [2]:
D = 100
y,x = F.shape
X,Y = meshgrid(range(x), range(y))
H = numpy.exp(-((X-x/2)**2 + (Y-y/2)**2)/2/D**2)
gimshow(H)



In [3]:
G = fftshift(F)*H
G = ifftshift(G)
g = ifft2(G).real
gimshow(g)



In [4]:
imsave('lp-gaussian.tif', g.astype(np.uint8))